﻿<UserControl
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:igDP="http://infragistics.com/DataPresenter"
  xmlns:igWindows="http://infragistics.com/Windows"
  xmlns:properties="clr-namespace:MediaDesktopPlayerAddIn.Properties"
  xmlns:wpf="clr-namespace:ViewOnCore.Helper.WPF;assembly=ViewOnCore"
  x:Class="UI.Control.VideoLibraryDialog"
  Height="360"
  Width="460">

	<UserControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="Views/DetailsView.xaml" />
				<ResourceDictionary Source="Views/ThumbnailsView.xaml" />
			</ResourceDictionary.MergedDictionaries>

			<CollectionViewSource x:Key="VideoViewContentDataSource"/>

			<!-- Context menu -->
			<ContextMenu x:Key="VideoContextMenuFolder">
				<MenuItem Header="{x:Static properties:Globalization.VideoLibraryDialog_ContextMenu_OpenFolder}"/>
				<MenuItem Header="{x:Static properties:Globalization.VideoLibraryDialog_ContextMenu_OpenFolderAsLibrary}"/>
				<MenuItem Header="{x:Static properties:Globalization.VideoLibraryDialog_ContextMenu_Remove}"/>
				<MenuItem Header="{x:Static properties:Globalization.VideoLibraryDialog_ContextMenu_Rename}"/>
			</ContextMenu>

			<ContextMenu x:Key="VideoContextMenuVideo">
				<MenuItem Header="{x:Static properties:Globalization.VideoLibraryDialog_ContextMenu_Play}"/>
				<MenuItem Header="{x:Static properties:Globalization.VideoLibraryDialog_ContextMenu_Remove}"/>
				<MenuItem Header="{x:Static properties:Globalization.VideoLibraryDialog_ContextMenu_Rename}"/>
                <Separator/>
                <MenuItem Header="{x:Static properties:Globalization.VideoLibraryDialog_ContextMenu_SendToVideoPlayer}"/>
			</ContextMenu>

			<ContextMenu x:Key="VideoContextMenuMultiples">
				<MenuItem Header="{x:Static properties:Globalization.VideoLibraryDialog_ContextMenu_Remove}"/>
			</ContextMenu>

		</ResourceDictionary>
	</UserControl.Resources>

	<!-- Normal window -->
	<wpf:ChildWindowDecorator x:Name="childWindowDecorator" IsResizable="True" HasMiniModeButton="True">

		<Border BorderThickness="0" BorderBrush="#F0444444" CornerRadius="4" Margin="1,1,1,1">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="30"/>
					<RowDefinition />
				</Grid.RowDefinitions>

				<Border Margin="2,2,2,2" Background="{DynamicResource VOColor1A}" CornerRadius="1" Opacity="0.5"/>
				<StackPanel x:Name="staToolbar" Orientation="Horizontal" Height="30" Margin="7,0,7,0">
					<Button x:Name="btnImport" Margin="5,2,5,2" Style="{DynamicResource Button.TransparentWithEffect2}" ToolTip="{x:Static properties:Globalization.VideoPart_TTImport}">
						<StackPanel Orientation="Horizontal">
							<wpf:Icon Source="/_images/PartVideo/import.png" Width="18" Height="18"/>
							<TextBlock Text="{x:Static properties:Globalization.VideoPart_Import}" Margin="5,0,5,0" VerticalAlignment="Center"/>
						</StackPanel>
					</Button>
					<Button x:Name="btnFolderUp" Margin="5,2,5,2" Style="{DynamicResource Button.TransparentWithEffect2}" ToolTip="{x:Static properties:Globalization.VideoLibraryDialog_TTUp}">
						<wpf:Icon Source="/_images/PartVideo/folder_up.png" Width="18" Height="18"/>
					</Button>
					<Button x:Name="btnFolderAdd" Margin="5,2,5,2" Style="{DynamicResource Button.TransparentWithEffect2}" ToolTip="{x:Static properties:Globalization.VideoLibraryDialog_TTAddVirtualFolder}">
						<wpf:Icon Source="/_images/PartVideo/folder_add.png" Width="18" Height="18"/>
					</Button>
					<Button x:Name="btnRemove" Margin="5,2,5,2" Grid.Column="1" Style="{DynamicResource Button.TransparentWithEffect2}" ToolTip="{x:Static properties:Globalization.VideoLibraryDialog_TTDeleteSelection}">
						<wpf:Icon Source="/_images/PartVideo/remove.png" Width="18" Height="18"/>
					</Button>
					<Button x:Name="btnRename" Margin="5,2,5,2" Grid.Column="1" Style="{DynamicResource Button.TransparentWithEffect2}" ToolTip="{x:Static properties:Globalization.VideoLibraryDialog_TTRenameSelection}">
						<wpf:Icon Source="/_images/PartVideo/rename.png"  SnapsToDevicePixels="True" Width="18" Height="18"/>
					</Button>
				</StackPanel>
				<StackPanel x:Name="staToolbarRight" Orientation="Horizontal" Height="30" HorizontalAlignment="Right">
					<TextBox x:Name="txtSearch" Width="150" VerticalAlignment="Center"/>
					<Button x:Name="btnSearch" Style="{StaticResource Button.TransparentWithEffect2}" ToolTip="{x:Static properties:Globalization.VideoPart_TTSearch}" Margin="1,1,20,1">
						<wpf:Icon Source="/_images/PartMusic/Search.png" Width="18" Height="18" />
					</Button>
					<ToggleButton x:Name="btnViewDetails" Margin="5,2,2,2" Style="{DynamicResource ToggleButton.WithEffect}" ToolTip="{x:Static properties:Globalization.VideoLibraryDialog_TTViewDetails}">
						<wpf:Icon Source="/_images/PartVideo/ViewDetails.png" Width="18" Height="18"/>
					</ToggleButton>
					<ToggleButton x:Name="btnViewImages" Margin="0,2,5,2" Style="{DynamicResource ToggleButton.WithEffect}" ToolTip="{x:Static properties:Globalization.VideoLibraryDialog_TTViewThumbnails}">
						<wpf:Icon Source="/_images/PartVideo/ViewImages.png" Width="18" Height="18"/>
					</ToggleButton>
				</StackPanel>

				<Grid x:Name="griSplittable"  Grid.Row="1">

					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="140"/>
						<ColumnDefinition Width="3"/>
						<ColumnDefinition/>
					</Grid.ColumnDefinitions>
					<Grid.RowDefinitions>
						<RowDefinition Height="30"/>
						<RowDefinition />
					</Grid.RowDefinitions>

					<TreeView x:Name="tvFolders" Grid.RowSpan="2" AllowDrop="True"/>

					<GridSplitter x:Name="gridSplitter" Grid.Column="1" Grid.RowSpan="2"  ResizeDirection="Columns" ResizeBehavior="PreviousAndNext" VerticalAlignment="Stretch" HorizontalAlignment="Left" Margin="1,0,1,0" Width="3" Background="{DynamicResource VOColor1A}"/>

					<!-- Navigation location -->
					<TextBlock x:Name="txtNavigation" Margin="2,2,2,2" Grid.Column="2" Grid.Row="0" FontWeight="Bold"  Foreground="{DynamicResource VOColor02}"/>

					<!-- Data Grid -->
					<igDP:XamDataPresenter
							x:Name="xdgMedias"
							Grid.Column="2"
							Grid.Row="1"
							IsGroupByAreaExpanded="False"
							IsNestedDataDisplayEnabled="True"
							GroupByAreaLocation="None"
							View="{DynamicResource DetailsView}"
							RecordContainerGenerationMode="LazyLoad"
							DataSource="{Binding Source={StaticResource VideoViewContentDataSource}}">

						<igDP:XamDataPresenter.FieldLayouts>
							<igDP:FieldLayout>
								<igDP:FieldLayout.Settings>
									<igDP:FieldLayoutSettings HighlightAlternateRecords="True" SelectionTypeRecord="Extended" SelectionTypeField="None" SelectionTypeCell="None" AutoGenerateFields="False" AllowDelete="False"/>
								</igDP:FieldLayout.Settings>
								<igDP:FieldLayout.Fields>
									<igDP:Field Name="IconSmall" Label="">
										<igDP:Field.Settings>
											<igDP:FieldSettings CellClickAction="SelectRecord"
													  CellWidth="20" CellMinWidth="20" CellMaxWidth="20" AllowEdit="False" AllowResize="False" LabelWidth="20" LabelMaxWidth="20" LabelMinWidth="20"
													  CellValuePresenterStyle="{StaticResource xdpIconSourceCellValuePresenter}"/>
										</igDP:Field.Settings>
									</igDP:Field>
									<igDP:Field Name="Title" Label="{x:Static properties:Globalization.VideoLibraryDialog_Title}" IsScrollTipField="True">
										<igDP:Field.Settings>
											<igDP:FieldSettings CellClickAction="SelectRecord" CellWidth="160" AllowEdit="False"/>
											<!-- AllowEdit="True" -->
										</igDP:Field.Settings>
									</igDP:Field>
									<igDP:UnboundField Name="Rating" Label="{x:Static properties:Globalization.VideoLibraryDialog_DetailsRating}">
										<igDP:UnboundField.Settings>
											<igDP:FieldSettings CellMinWidth="82" CellWidth="82" CellMaxWidth="82" CellValuePresenterStyle="{StaticResource RatingImage}" CellClickAction="SelectRecord" AllowEdit="False"/>
										</igDP:UnboundField.Settings>
									</igDP:UnboundField>
									<!--igDP:Field Name="FormattedGenres" Label="{x:Static properties:Globalization.VideoLibraryDialog_DetailsGenres}">
									<igDP:Field.Settings>
										<igDP:FieldSettings CellWidth="80" CellClickAction="SelectRecord" AllowEdit="False"/>
									</igDP:Field.Settings>
								</igDP:Field-->
									<igDP:Field Name="Path" Label="{x:Static properties:Globalization.VideoLibraryDialog_Path}" IsScrollTipField="True">
										<igDP:Field.Settings>
											<igDP:FieldSettings CellClickAction="SelectRecord" CellWidth="300" AllowEdit="False"/>
										</igDP:Field.Settings>
									</igDP:Field>
								</igDP:FieldLayout.Fields>
							</igDP:FieldLayout>
						</igDP:XamDataPresenter.FieldLayouts>
					</igDP:XamDataPresenter>

				</Grid>
			</Grid>
		</Border>

	</wpf:ChildWindowDecorator>

</UserControl>
